package com.example.jobback.controller.recruiter;

import com.example.jobback.resp.recruiter.deliver.RecruiterCandidateResp;
import com.example.jobback.resp.recruiter.deliver.SeekerResumeResp;
import com.example.jobback.result.Result;
import com.example.jobback.service.recruiter.RecruiterDeliverService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName: RecruiterDeliverController
 * @Description:招聘者-投递控制器
 * @Author: lhb
 * @Date: 2025/7/17
 */
@RestController
@RequestMapping("/recruiter/deliver")
@Tag(name = "招聘者-投递控制器",description = "招聘者投递服务对应的相关接口")
public class RecruiterDeliverController {

    private final RecruiterDeliverService recruiterDeliverService;

    public RecruiterDeliverController(RecruiterDeliverService recruiterDeliverService) {
        this.recruiterDeliverService = recruiterDeliverService;
    }

    @Operation(summary = "获取已投递",description = "")
    @ApiResponse(description = "返回响应体列表")
    @GetMapping("/getDeliverList")
    public Result<List<RecruiterCandidateResp>> getDeliverList(){
        return recruiterDeliverService.getDeliverList();
    }

    @Operation(summary = "获取已面试",description = "")
    @ApiResponse(description = "返回响应体列表")
    @GetMapping("/getInterviewList")
    public Result<List<RecruiterCandidateResp>> getInterviewList(){
        return recruiterDeliverService.getInterviewList();
    }

    @Operation(summary = "邀约面试",description = "请求参数是投递主键id，响应体仔细看一下")
    @ApiResponse(description = "返回响应体列表")
    @PostMapping("/interview")
    public Result<Object> interview(@Parameter(description = "投递主键id", required = true)
                                        @RequestParam Long id){
        return recruiterDeliverService.interview(id);
    }

    @Operation(summary = "根据UserId查看求职者简历",description = "无")
    @ApiResponse(description = "无")
    @GetMapping("/getSeekerResume")
    public Result<SeekerResumeResp> getSeekerResume(@Parameter(description = "用户userId", required = true)
                                                    @RequestParam Long userId){
        return recruiterDeliverService.getSeekerResume(userId);
    }

}
